import React, { useEffect } from "react";
import { RouterProvider } from "react-router";
import router from "./router";
import { getQueryParams } from "@/utils/tootls";
import { settoken } from "@/utils/auth";

const App: React.FC = () => {
  useEffect(() => {
    const queryParams = getQueryParams(window.location.href);
    console.log(queryParams, "queryParams");
    if (queryParams.dlfninekot) {
      settoken(queryParams.dlfninekot);
    }
  }, []);

  return <RouterProvider router={router} />;
};

export default App;
